package com.moon.fragment;

import android.content.Intent;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;

import com.actionbarsherlock.app.SherlockFragment;
import com.moon.R;
import com.moon.app.TopicListActivity;
import com.moon.constants.MoonConstants;

public class ChatFragment extends SherlockFragment{
	
    
    LinearLayout square;
    
	public static ChatFragment newInstance(){
		ChatFragment chatFragment = new ChatFragment();
		return chatFragment;
	}
	
	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View view = inflater.inflate(R.layout.chat_fragment, null);
		
		square = (LinearLayout)view.findViewById(R.id.square);
		square.setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View v) {
                //后面应该跳list
                Intent intent =new Intent(v.getContext(), TopicListActivity.class);
                intent.putExtra(MoonConstants.TOPIC_CATEGORY_ID, MoonConstants.APP_SQUARE_CATEGORY_ID);
                startActivity(intent);
            }
        });
		
		
		return view;
	}
}
